<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html;charset=utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>生成订单 - 当当网</title>
<link href="${pageContext.request.contextPath}/css/login.css" rel="stylesheet" type="text/css" />
<link href="${pageContext.request.contextPath}/css/page_bottom.css" rel="stylesheet" type="text/css" />
<link href="${pageContext.request.contextPath}/css/address.css" rel="stylesheet" type="text/css" />

</head>
<body>
	<%@include file="../common/head1.jsp"%>
	<div class="login_step">
		生成订单骤: 1.确认订单 ><span class="red_bold"> 2.填写送货地址</span> > 3.订单成功
	</div>
	<div class="fill_message">
		 
		 <form action="${pageContext.request.contextPath}/order/createOrder.do" method="post">
			 <div class="address-wrap">
				<ul class="address-list">
					<c:forEach items="${requestScope.addressList}" var="address">
						<c:if test="${address.selected_status == 0}">
							<li class="address-wrap" onclick="changeAddress(this)">
						</c:if>
						 <c:if test="${address.selected_status == 1}">
							 <li class="address-wrap selected" onclick="changeAddress(this)">
							<div class="addressBox">
								<span class="marker-tip">寄送至</span>
							</div>
						 </c:if>
							<label class="addressInfo">
								<c:if test="${address.selected_status == 0}">
									<input type="radio" name="address" value="${address.id}"/>
								</c:if>
								<c:if test="${address.selected_status == 1}">
									<input type="radio" name="address" checked="checked" value="${address.id}"/>
								</c:if>
								<span class="user-address">
									<span >${address.address} </span>
									<span>${address.address} </span>
									<span>（</span>
									<span>${address.receive_name}</span>
									<span> 收）</span>
									<em>${address.mobile}</em>
								</span>
							</label>
						</li>
					</c:forEach>
				</ul>
			</div>
			
			<div class="login_in">
				<input
					id="btnClientRegister" class="button_1" name="submit" type="submit"
					value="下一步" />
			</div>
			
		</form>
	</div>
	<%@include file="../common/foot1.jsp"%>
	<script type="text/javascript">
		function changeAddress(domObj) {
			document.querySelector("li.selected").className="address-wrap";
			domObj.className = "address-wrap selected";
			domObj.prepend(document.querySelector("div.addressBox"));
		}
	</script>
</body>
</html>

